package com.moorror.codegenvel.common.tree.actions;

import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.project.DumbAware;
import org.jetbrains.annotations.NotNull;

import javax.swing.*;
import java.util.function.Consumer;

/**
 * @Author jiyanghuang
 * @Date 2025/8/24 17:38
 */
public class TransferCallbackAction extends AnAction implements DumbAware {

    private Consumer<AnActionEvent> consumer;

    public TransferCallbackAction(String title, String desc, Icon icon, Consumer<AnActionEvent> consumer) {
        super(title, desc, icon);
        this.consumer = consumer;
    }

    @Override
    public void actionPerformed(@NotNull AnActionEvent e) {
        consumer.accept(e);
    }
}
